package com.zaydanwu.cla;

import com.zaydanwu.cla.model.result.ApiResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: cla
 * @BelongsPackage: com.zaydanwu.cla
 * @Author: zaydanwu
 * @CreateTime: 2019-01-05 17:25
 * @Description:
 */
@ControllerAdvice
@RestController
public class ExceptionHandler {
    @org.springframework.web.bind.annotation.ExceptionHandler(Exception.class)
    public ApiResult handle(Exception e) {
        e.printStackTrace();
        return ApiResult.failure("后台出现不可描述的错误", e.getMessage());
    }
}
